package scala.patternMatching

object CaseSequenceAsPartialFunc {
   def main(args: Array[String]): Unit = {
      val c = definition(Some(10))
      println(c)
   }
   
   val definition:Option[Int] => Int = {
      case Some(x) =>x
      case None => 0
   }
   
   /*val second = new PartialFunction[List[Int], Int]{
      
      def apply(l:List[Int]) = {
         l match {
            case x::y::_ =>y
         }
      }
      
      def isDefinedAt(l:List[Int]) = l match{
         case x::y::_ => true
         case _ => false
      }
   }*/
}